﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace WHMS.EntityClasses
{
	public partial class TransactionItemEntity
	{
		public int NewShelfId { get; set; }
		public string ItemName 
		{ 
			get 
			{
				if(Item != null)
					return Item.Name;

				return string.Empty;
			} 
		}
		public string ItemCode
		{
			get
			{
				if (Item != null)
					return Item.Code;

				return string.Empty;
			}
		}

        public decimal Weight
        {
            get
            {
                return this.Quantity * (this.Item != null ? this.Item.Weight : 0);
            }
        }

		public string ItemUnit
		{
			get
			{
				if (Item != null && Item.Unit != null)
					return Item.Unit_.Name;

				return string.Empty;
			}
		}

		public int ItemTypeId
		{
			get
			{
				if (Item != null && Item.TypeId.HasValue)
					return Item.TypeId.Value;

				return 0;
			}
		}
	}
}

